﻿using System;
using System.Windows.Forms;

namespace Ellanet
{
    public partial class Options : Form
    {
        public int PingInterval { get; set; }
        public bool PingSuccessfulHosts { get; set; }
        public bool ContinuallyPing { get; set; }

        public Options(int pingInterval, bool pingSuccessfulHosts, bool continuallyPing)
        {
            InitializeComponent();
            intervalNumericUpDown.Value = pingInterval;
            successCheckBox.Checked = !pingSuccessfulHosts;
            continualCheckBox.Checked = continuallyPing;
            okButton.Click += okButton_Click;
        }

        private void okButton_Click(object sender, EventArgs e)
        {
            PingInterval = Convert.ToInt32(intervalNumericUpDown.Value);
            PingSuccessfulHosts = !successCheckBox.Checked;
            ContinuallyPing = continualCheckBox.Checked;
            DialogResult = DialogResult.OK;
            Close();
        }
    }
}
